#include "StdAfx.h"
#include "Rectangle.h"

CRectangle::CRectangle(void)
{
}

CRectangle::CRectangle(CPoint3D pBegin, CPoint3D pEnd)
{
	m_Begin = pBegin;
	m_End = pEnd;
}

CRectangle::~CRectangle(void)
{
}

void CRectangle::Draw()
{
	// if the object is selected, the drawing color is blue. Otherwise, it is black.
	if (selected)
		glColor3fv(blue);
	else 
		glColor3fv(black);

	glBegin(GL_QUADS);
		glVertex2f(m_Begin.getX(), m_Begin.getY());
		glVertex2f(m_Begin.getX(), m_End.getY());
		glVertex2f(m_End.getX(), m_End.getY());
		glVertex2f(m_End.getX(), m_Begin.getY());
	glEnd();
}
